package com.azier.kapacitor.script.node;

import com.azier.kapacitor.script.method.*;
import com.azier.kapacitor.script.node.nodebind.*;
import com.azier.kapacitor.script.node.nodebind.qlnodebind.*;

import java.util.ArrayList;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Create a new Barrier node that emits a BarrierMessage periodically
**/

/**
创建一个新的Barrier节点，该节点定期发出BarrierMessage
**/
public class SwarmAutoscaleNode extends AbstractNode implements AlertNodeBind, BarrierNodeBind, BottomNodeBind, ChangeDetectNodeBind, CombineNodeBind,
        CountNodeBind, CumulativeSumNodeBind, DefaultNodeBind, DeleteNodeBind, DerivativeNodeBind, DifferenceNodeBind, DistinctNodeBind, Ec2AutoscaleNodeBind,
        ElapsedNodeBind, EvalNodeBind, FirstNodeBind, FlattenNodeBind, GroupByNodeBind, HoltWintersNodeBind, HoltWintersWithFitNodeBind, HttpOutNodeBind,
        HttpPostNodeBind, InfluxDBOutNodeBind, JoinNodeBind, K8sAutoscaleNodeBind, KapacitorLoopbackNodeBind, LastNodeBind, LogNodeBind, MeanNodeBind,
        MedianNodeBind, ModeNodeBind, MovingAverageNodeBind, PercentileNodeBind, SampleNodeBind, ShiftNodeBind, SideloadNodeBind, SpreadNodeBind,
        StateCountNodeBind, StateDurationNodeBind, StatsNodeBind, StddevNodeBind, SumNodeBind, SwarmAutoscaleNodeBind, TopNodeBind, UnionNodeBind,
        WhereNodeBind, WindowNodeBind{
    private static final String name = "swarmAutoscale";

    public SwarmAutoscaleNode() {
        super(new ArrayList<>(),new ArrayList<>(),name);
    }

    public SwarmAutoscaleNode cluster(String value){
        Cluster cluster = new Cluster(value);
        super.addMethod(cluster);
        return this;
    }

    public SwarmAutoscaleNode currentField(String value){
        CurrentField currentField = new CurrentField(value);
        super.addMethod(currentField);
        return this;
    }

    public SwarmAutoscaleNode decreaseCooldown(long interval, String durationLiteral){
        DecreaseCooldown decreaseCooldown = new DecreaseCooldown(interval, durationLiteral);
        super.addMethod(decreaseCooldown);
        return this;
    }

    public SwarmAutoscaleNode increaseCooldown(long interval, String durationLiteral){
        IncreaseCooldown increaseCooldown = new IncreaseCooldown(interval, durationLiteral);
        super.addMethod(increaseCooldown);
        return this;
    }

    public SwarmAutoscaleNode max(Long value){
        Max max = new Max(value);
        super.addMethod(max);
        return this;
    }
    public SwarmAutoscaleNode min(Long value){
        Min min = new Min(value);
        super.addMethod(min);
        return this;
    }

    /**
     Define a field default.
     **/
    /**
     定义字段默认值。
     **/
    public SwarmAutoscaleNode outputServiceNameTag(String value){
        OutputServiceNameTag  outputServiceNameTag = new OutputServiceNameTag (value);
        super.addMethod(outputServiceNameTag);
        return this;
    }

    public SwarmAutoscaleNode quiet(){
        Quiet quiet = new Quiet();
        super.addMethod(quiet);
        return this;
    }

    public SwarmAutoscaleNode replicas(String condition){
        Replicas replicas = new Replicas(condition);
        super.addMethod(replicas);
        return this;
    }

    public SwarmAutoscaleNode serviceName(String value){
        ServiceName serviceName = new ServiceName(value);
        super.addMethod(serviceName);
        return this;
    }
    public SwarmAutoscaleNode serviceNameTag(String value){
        ServiceNameTag serviceNameTag = new ServiceNameTag(value);
        super.addMethod(serviceNameTag);
        return this;
    }
}